package com.ruoyi.points.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.points.mapper.BargainProductMapper;
import com.ruoyi.points.domain.BargainProduct;
import com.ruoyi.points.service.IBargainProductService;

/**
 * 砍价商品Service业务层处理
 *
 * @author ruoyi
 * @date 2024-08-05
 */
@Service
public class BargainProductServiceImpl implements IBargainProductService
{
    @Autowired
    private BargainProductMapper bargainProductMapper;

    /**
     * 查询砍价商品
     *
     * @param id 砍价商品主键
     * @return 砍价商品
     */
    @Override
    public BargainProduct selectBargainProductById(Long id)
    {
        return bargainProductMapper.selectBargainProductById(id);
    }

    /**
     * 查询砍价商品列表
     *
     * @param bargainProduct 砍价商品
     * @return 砍价商品
     */
    @Override
    public List<BargainProduct> selectBargainProductList(BargainProduct bargainProduct)
    {
        return bargainProductMapper.selectBargainProductList(bargainProduct);
    }

    /**
     * 新增砍价商品
     *
     * @param bargainProduct 砍价商品
     * @return 结果
     */
    @Override
    public int insertBargainProduct(BargainProduct bargainProduct)
    {
        return bargainProductMapper.insertBargainProduct(bargainProduct);
    }

    /**
     * 修改砍价商品
     *
     * @param bargainProduct 砍价商品
     * @return 结果
     */
    @Override
    public int updateBargainProduct(BargainProduct bargainProduct)
    {
        return bargainProductMapper.updateBargainProduct(bargainProduct);
    }

    /**
     * 批量删除砍价商品
     *
     * @param ids 需要删除的砍价商品主键
     * @return 结果
     */
    @Override
    public int deleteBargainProductByIds(Long[] ids)
    {
        return bargainProductMapper.deleteBargainProductByIds(ids);
    }

    /**
     * 删除砍价商品信息
     *
     * @param id 砍价商品主键
     * @return 结果
     */
    @Override
    public int deleteBargainProductById(Long id)
    {
        return bargainProductMapper.deleteBargainProductById(id);
    }
}
